home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / graph-3d.zip / GRAPHICS.DOC < prev    next >
Text File  |  1991-10-18  |  9KB  |  200 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.           These programs originally  appeared in Hot  CoCo magazine, June  1983,
  7.           pages 94 to 107. They were written for the Color Computer by Delmar E.
  8.           Searls (see end of this document) and I converted them  to the PC with
  9.           some adjustments to the program. These versions do not save the images
  10.           created as the original programs did but the graphics  drawn as pretty
  11.           much the  same  as the  original.  In CGA  the  graphics are  slightly
  12.           stretched out in the vertical due to the shape of the CGA's pixel (dot
  13.           on the screen). In EGA  the drawings are pretty  much the same as  the
  14.           photos that were contained within the article in Hot CoCo Magazine and
  15.           are  pretty  much what  I  obtained  with the  Color  Computers 256x96
  16.           resolution at that time.
  17.  
  18.                The basic versions  are in CGA,  640x200 resolution. The size  of
  19.           the graphic is controlled by the  `(30*' or `(25*' values depending on
  20.           the program (option).  The general location  on the  screen is at  320
  21.           horizontal and 100 vertical. I made some  adjustments to 90 and 110 on
  22.           vertical to keep some displays in the center of the screen.
  23.  
  24.                I took  all the  separate segments  and assembled  them into  one
  25.           basic program titled GRAPHCGA. The program  in both basic and compiled
  26.           basic  using  Microsoft's  Quick  Basic.  I  was a  firm  believer  in
  27.           Borland's Turbo Basic but Quick Basic is much faster. I  have included
  28.           BRUN30.EXE  which is needed to run the compiled programs. Make sure it
  29.           is somewhere on your path. I keep my copy in my utility directory.
  30.  
  31.                I also made an  assembled version in EGA, 640x350  resolution and
  32.           is titled GRAPHEGA.  I was able to  use screen 9 to get  the EGA mode.
  33.           There also is a VGA, 640x480 resolution and is titled GRAPHVGA.
  34.  
  35.                At the completion of each graphic the computer makes a tone every
  36.           one and a half seconds without displaying anything on the screen. This
  37.           is to  notify you that the graphic has been  completed. If you plan to
  38.           do any screen dumps to a file or to the printer this is the time to do
  39.           it.  If  you press  any key  a  prompt of  `Press <R>epeat,  <N>ext or
  40.           <E>xit' appears  on line  twenty five.  Pressing <R>  will repeat  the
  41.           current graphic and you may change  the inputs if so desired. Pressing
  42.           <N> proceeds to the  next graphic and it's input  statements. Pressing
  43.           <E> exits the program. Upper or lower case is acceptable.
  44.  
  45.                In the  EGA and  VGA versions  I made  the displays  as large  as
  46.           possible changing most of  the `30's to `60's/'70's and  those options
  47.           using `30 and 25' to `50/60 and 42/52' (same ratio). Other  than these
  48.           two changes the EGA, VGA, and CGA versions are the same.
  49.  
  50.                I worked these out on an 80286 12 mhz turbo and the display speed
  51.           will vary depending  on the machine. On the original Color Computer it
  52.           took several minutes to draw  some of these and  the time should be  a
  53.           little faster on  a 4.77 mhz PC  since the .EXE programs  are compiled
  54.           programs (run 10  to 100 times  faster). So be  prepared for a  little
  55.           wait on some machines if you do not have an 80286 machine.
  56.  
  57.                The programs prompt  you for  all or part  of the following,  (1)
  58.           LINE DENSITY. A MAX of 8 is suggested. (2) DOT DENSITY. 16,  32 and 64
  59.           are  suggested. (3) VIEWING  ANGLE. 65 to 75  degrees is suggested. In
  60.           all  the  segments and  assembled programs  the author's  defaults are
  61.           built in. If you enter something like 100 degrees you start seeing the
  62.           bottom side of  the graphic. On EGA  and VGA color systems  the bottom
  63.           side is yellow and if any yellow is showing this is the bottom side or
  64.           parts there  of. This  bottom color  is not  possible in  CGA 2  color
  65.           640x200 screen. If  you press <ENTER> on  any or all of  these prompts
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.           you get a pretty good display.
  73.  
  74.                I have also included  the program CROSS-SE for Cross  Section and
  75.           is only useful  in basic so you can  change line 1010. This  is to let
  76.           you experiment with cross sections changing the values in line 1010 in
  77.           the basic version. If you change the assembled versions you will  have
  78.           to find  the appropriate line since  these were renumbered  as I added
  79.           the separate segments together.
  80.  
  81.                You  can  run   the  Cross  Section   "and  can  eliminate   many
  82.           possibilities  by viewing  these  cross sections.  Make note  of those
  83.           functions that  look promising and try them out  in one of the display
  84.           programs. In the Basic  exponential function is written EXP(  ), where
  85.           some expression  involving R  is placed  inside the  parentheses. This
  86.           expression in the exponent  of the number "e" (about 2.718).  It would
  87.           be equally suitable,  from a  graphing standpoint, to  use some  other
  88.           base such as 2 or 3. The function would  be written as 2^( ) or 3^( ),
  89.           where again an expression involving R goes in the parentheses.
  90.  
  91.                If the  base is a  number greater  than one, then  the expressing
  92.           inside the parentheses (the  exponent) should be negative or  zero. If
  93.           the exponent is positive,  the altitude will quickly become  too large
  94.           to plot.  Z=EXP(-R),  Z=1.5*2^(-R*r),  and  Z=2*3^(-R*R/4)-1  are  all
  95.           examples where the exponent is a negative or zero. Remember that  R is
  96.           a distance and  is always positive. The  negative sign in each  of the
  97.           exponents makes the  exponent negative, or zero  at most. Each of  the
  98.           would produce a display resembling a mound.
  99.  
  100.                The height  of the mound is determined by the multiplies (if any)
  101.           in  front. The first would have a height  of 1, the second a height of
  102.           1.5, and the third a height of 2.  In addition, if the display for the
  103.           third  Z  function  would be  lower  on  the screen  because  a  1 was
  104.           subtracted from the height calculation.
  105.  
  106.                The trigonometric functions (sine and  cosine) produce the graphs
  107.           that look like ripples in a pond. In Basic these functions are written
  108.           SIN( )  and COS(  ), where  once more  they contain   some  expression
  109.           involving  R. The  values  will range  from  -1 to  1,  with the  sine
  110.           function zero  at the origin, and the cosine  function equal to one at
  111.           the origin. The range can be adjusted by multiplying the trig function
  112.           by some number or by some other function (such as the exponential).
  113.  
  114.                Most  of  the   displays  commonly   seen  are  combinations   of
  115.           trigonometric functions or of trigonometric and exponential functions.
  116.           This is  where the  trial and  error process  enters in;  you enter  a
  117.           function in line 1010  and see what you get. If you don't like it, try
  118.           again."
  119.  
  120.                There  are  three different  display  programs in  the  basic and
  121.           assembled versions.
  122.  
  123.                I hope you  enjoy this as it  is. The magazine article  is pretty
  124.           complex and extensive.  If you can get the above mentioned copy of the
  125.           magazine you can copy or read the original  instructions. I have tried
  126.           to  cover  what is  done  to use  the  program CROSS-SE  which  is the
  127.           author's listing 5 in the article.
  128.  
  129.                                    James Huckabey      
  130.                                    3621-A Fraser Street
  131.                                    Bellingham, WA 98226
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.                Original author is;
  139.  
  140.                                   Delmar E. Searls       
  141.                                   1825 S. Johnstone     
  142.                                   Bartlesville, OK 74003
  143.  
  144.           as of June 1983 when the article was published ...
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.